package com.hd123.rumba.gwt.widget2.client.grid;

import java.util.ArrayList;
import java.util.Iterator;

/**
 * RGridSortListener集合
 * 
 * @author LiQi
 * 
 */
public class RGridSortListenerCollection extends ArrayList {

  private static final long serialVersionUID = 1L;

  /**
   * 触发所有监听器的sort事件
   * 
   * @param sender
   * @param sortColumn
   *          排序的列定义
   * @param sortDir
   *          排序方式，取值范围为{@link RGrid#SORT_ASC}和
   *          {@link RGrid#SORT_DESC}
   */
  public void fireSort(RGrid sender, RGridColumnDef sortColumn, String sortDir) {
    for (Iterator it = iterator(); it.hasNext();) {
      RGridSortListener listener = (RGridSortListener) it.next();
      listener.onSort(sender, sortColumn, sortDir);
    }
  }
}
